<template>
    <a-card :bordered="false">
        <div class="table-page-search-wrapper">
        <a-form layout="inline" :form="form" @submit="handleSubmit">
            <a-row :gutter="48">
            <a-col :md="8" :sm="24">
                <a-form-item label="集团卡号">
                    <a-input placeholder="请输入集团卡号"
                     v-decorator="['groupCardNo',{ rules: [{ required: true, message: '请输入集团卡号' }] },]"
                    />
                </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
                 <a-form-item label="品牌">
      <a-select
        v-decorator="[
          'brand',
          { rules: [{ required: true, message: '请选择品牌' }] },
        ]"
        placeholder="请选择品牌"
        @change="handleSelectChange"
      >
        <a-select-option :value="item.weid" v-for="item in brand" :key="item.weid">
          {{item.name}}
        </a-select-option>
        
      </a-select>
    </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
                <span class="table-page-search-submitButtons">
                <a-button type="primary" html-type="submit">同步</a-button>
                <a-button style="margin-left: 8px" @click="reset">重置</a-button>
                </span>
            </a-col>
            </a-row>
        </a-form>
        </div>
    </a-card>
</template>
<script>
import { asyncVip } from '@/api/micromall'
export default {
    name:'asyncVip',
    data(){
        return {
            form:this.$form.createForm(this),
            queryParam:{
                groupCardNo:''
            },
            brand:[{
                weid:2738574294,
                name:'JNBY'
            },{
                weid:2822095692,
                name:'less'
            },{
                weid:2504948039,
                name:'CROQUIS'
            },{
                weid:4,
                name:'jnby by JNBY'
            },{
                weid:6924108367,
                name:'Pomme de terre'
            },{
                weid:15,
                name:'APN73'
            },{
                weid:8348044436,
                name:'JNBYHOME'
            },{
                weid:11,
                name:'Outlet'
            },{
                weid:5,
                name:'江南布衣+'
            }]
        }
    },
    methods:{
        async submit(values){
            const {groupCardNo:cno,brand:weid} = values
            const re = await asyncVip({cno,weid})
            if(re.code == 200){
                this.$message.success('异步处理中...',3,)
            }
            console.log(re)
        },
        reset(){
            this.form.resetFields()
        },
        handleSubmit(e) {
            e.preventDefault();
            this.form.validateFields((err, values) => {
                if (!err) {
                    this.submit(values);
                }
            });
        },
        handleSelectChange(value){
            // this.form.setFieldsValue({
            // note: `${value}`,
            // });
        }
    }
}
</script>
<style scoped>

</style>